home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / utilit~1 / initsnb.zoo / init / sh / dinfo < prev    next >
Encoding:
Text File  |  1992-09-09  |  1.2 KB  |  46 lines

  1. #! /bin/sh
  2. # dinfo: Info about filesystem dumps
  3. # Usage: dinfo [device...]
  4. # If no devices are specified, print info for all devices
  5. PATH=/bin:/usr/bin
  6. root=u:
  7. program=`basename $0`
  8. infofile=$root/etc/dumpinfo
  9. datesfile=$root/etc/dumpdate
  10.  
  11. if test ! -f $infofile ; then
  12.   echo $program: Dump information file $infofile not found
  13.   exit 1
  14. fi
  15.  
  16. if test ! -f $dates ; then
  17.   echo $program: Dump dates file $datesfile not found
  18.   exit 1
  19. fi
  20.  
  21. if test $# -eq 0 ; then
  22.   devices="c d e f g h i j k l m n o"
  23. else
  24.   devices=$*
  25. fi
  26.  
  27. echo "F L Dump starting date  Dump ending date    File                  Size now"
  28. echo  ----------------------------------------------------------------------------
  29.  
  30. for dev in $devices ; do
  31.   device=/dev/$dev
  32.   gawk '
  33.     $0 ~ /^Level [0-9]+ dump of [^ ]+ started on [^ ]+ [^ ]+$/ {
  34.         if ($5 == device)
  35.           printf "%s %s %s %s ", substr (device, 6, 1), $2, $8, $9;
  36.       }
  37.     $0 ~ /^Level [0-9]+ dump of [^ ]+ ended on [^ ]+ [^ ]+ \(written on [^ ]+\)$/ {
  38.         if ($5 == device) {
  39.           printf "%s %s %s ", $8, $9, substr ($12, 1, length ($12) - 1);
  40.       getline; getline; printf "%-10lu\n", $5;
  41.         }
  42.       }
  43.   ' device=$device $infofile
  44. done
  45.  
  46.